import React, {Component} from 'react';

class Sub extends Component {

    subCounter(counter) {
        this.props.onChange(counter)
    }

    render() {
        return (
            <div>
                <div>
                    <button onClick={() => this.subCounter(-1)}>-1</button>
                    <button onClick={() => this.subCounter(-5)}>-5</button>
                    <button onClick={() => this.subCounter(-10)}>-10</button>
                </div>
            </div>
        );
    }
}

export default Sub;